package com.scy.java.object;

public class RectangleDemo {
    public static void main(String[] args) {
        //创建长度为三的数组
        Rectangle[] rtg = new Rectangle[3];
        for (int i = 0; i < rtg.length; i++) {
            //给数组元素赋值
            rtg[i] = new Rectangle();
            //给矩形对象属性赋值
            rtg[i].length = 10*(i+1);
            rtg[i].width = 5*(2*i+1);
            System.out.println(rtg[i].getinfo());
        }

    }
}
